home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / info.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-30  |  2.9 KB  |  87 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. /*  Info.c  */
  22.  
  23. #include <externs.h>
  24.  
  25.  
  26. unsigned AVL_NBYTES()
  27. {
  28.     AVL_EDIT_WINDOW_PTR w;
  29.     AVL_LINE_PTR temp;
  30.     unsigned n = 0;
  31.     w = &avl_windows[avl_window];
  32.     for (temp = w -> head -> next; temp != w -> head; temp = temp -> next)
  33.         n += (strlen(temp -> line) + 1);
  34.     if ((w -> head -> previous -> line_no == 2) &&
  35.         (strlen(w -> head -> next -> line) == 0)) --n;
  36.     return n;
  37. }
  38.  
  39. void AVL_ABOUT_GWADA() 
  40. {  
  41.     struct diskfree_t *dks;
  42.     short co;
  43.     int n, k;
  44.     char line[180];
  45.     char l2[100];
  46.     AVL_WIN_PTR w;
  47.     sprintf(line," Info - GWAda V %s - By A. V. Lopes & M. B. Feldman ",GWAda_Version);
  48.     n = strlen(line) + 2;
  49.     k = (80 - n) / 2;
  50.     w = AVL_MAKE_WINDOW(line,5,k,14+5,k+n+2,avl_wnd_bk_color,avl_wnd_color);
  51.     _settextposition(2,2);
  52.     sprintf(line,"Current drive and directory: %s", avl_curr_directory);
  53.     _outtext(line);
  54.     _settextposition(3,2);
  55.     sprintf(line,"Source directory           : %s", avl_dir_sources);
  56.     _outtext(line);
  57.     _settextposition(4,2);
  58.     sprintf(line,"Library directory          : %s", avl_dir_library);
  59.     _outtext(line);
  60.  
  61.     _settextposition(6,2);
  62.     if (_dos_getdiskfree(0,dks) != 0)  
  63.         sprintf(line,"Disk space available       : unknown");
  64.     else
  65.         sprintf(line,"Disk space available       : %ldKb",
  66.             (((dks -> bytes_per_sector * 1L) *  
  67.                dks -> sectors_per_cluster) * dks -> avail_clusters) / 1024L);
  68.     _outtext(line);
  69.     _settextposition(7,2);
  70.     sprintf(line,"Extended memory available  : %ldKb", _memavl() / 1024L);
  71.     _outtext(line);
  72.     _settextposition(8,2);
  73.     sprintf(line,"Active text file name      : %s", avl_windows[avl_window].file_name);
  74.     _outtext(line);
  75.     _settextposition(9,2);
  76.     sprintf(line,"     No. of text lines     : %d", 
  77.         avl_windows[avl_window].head -> previous -> line_no - 1);
  78.     _outtext(line);
  79.     _settextposition(10,2);
  80.     sprintf(line,"     No. of text characters: %u", AVL_NBYTES());
  81.     _outtext(line);
  82.     _settextposition(12,2);
  83.     _settextcolor(9);
  84.     _outtext("Press any key to return to top menu...");
  85.     if ((k = getch()) == 0) k = getch();
  86.     AVL_DEL_WINDOW(w);
  87. }
  88.